package Action;

import hibconfig.HibernateSessionFactory;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.Transaction;

import com.opensymphony.xwork2.ActionContext;

import entity.Student;

public class ShowMyGrade {
	public String stuid;

	public String getStuid() {
		return stuid;
	}

	public void setStuid(String stuid) {
		this.stuid = stuid;
	}
	public String execute(){	
		Session session=HibernateSessionFactory.getSession();
		Transaction tran=session.beginTransaction();
		String hql="from Student  where stuid='"+stuid+"'";		
		List<Student> list=session.createQuery(hql).list();
		ActionContext act=ActionContext.getContext();
		act.put("gradelist", list);		 
		tran.commit();
		return "success";
		}
}
